package com.kk.score.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.kk.score.entity.UserEntity;
import com.kk.score.utils.PageUtils;
import com.kk.score.utils.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.kk.score.dao.DepartmentDao;
import com.kk.score.entity.DepartmentEntity;
import com.kk.score.service.DepartmentService;
import org.springframework.util.StringUtils;


@Service("departmentService")
public class DepartmentServiceImpl extends ServiceImpl<DepartmentDao, DepartmentEntity> implements DepartmentService {

    @Autowired
    private DepartmentDao departmentDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String status = (String) params.get("status");
        if (!StringUtils.hasText(status)) {
            status = "1";
        }
        return new PageUtils(departmentDao.findDepartmentPage(new Query<DepartmentEntity>().getPage(params), status));
    }

}